package com.xci.core.configuration;

import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * 配置缓存
 */
@Configuration
public class CacheConfig {
    @Resource
    private CacheManager cacheManager;

    @Bean
    public Cache userCache() {
        return cacheManager.getCache("userCache");
    }

    @Bean
    public Cache roleCache() {
        return cacheManager.getCache("roleCache");
    }

    @Bean
    public Cache deptCache() {
        return cacheManager.getCache("deptCache");
    }

    @Bean
    public Cache dicCache() {
        return cacheManager.getCache("dicCache");
    }

    @Bean
    public Cache paramCache() {
        return cacheManager.getCache("paramCache");
    }

    @Bean
    public Cache appCache() {
        return cacheManager.getCache("appCache");
    }

    @Bean
    public Cache reportCache() {
        return cacheManager.getCache("reportCache");
    }

    @Bean
    public Cache onlineUserCache() {
        return cacheManager.getCache("onlineUserCache");
    }

    @Bean
    public Cache lockUserCache() {
        return cacheManager.getCache("lockUserCache");
    }

    @Bean
    public Cache captchaCache() {
        return cacheManager.getCache("captchaCache");
    }

    @Bean
    public Cache userModuleCache() {
        return cacheManager.getCache("userModuleCache");
    }
}